﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DynaPrecision.CommonCollection
{
	public class LargeList<T> : IList<T>
	{
		public static int SegmentSize = 5000;

		protected List<List<T>> _storage = new List<List<T>>();



		#region IList<T> Members

		public int IndexOf(T item)
		{
			throw new NotImplementedException();
		}

		public void Insert(int index, T item)
		{
			throw new NotSupportedException("Due to the design of large list, you can only add items at the end");
		}

		public void RemoveAt(int index)
		{
			throw new NotSupportedException("Due to the design of large list, you can only remove items at the end");
		}

		public T this[int index]
		{
			get
			{
				while (index < SegmentSize)
				{

				}
				return _storage[index / SegmentSize][index % SegmentSize];
			}
			set
			{
				_storage[index / SegmentSize][index % SegmentSize] = value;
			}
		}

		#endregion

		#region ICollection<T> Members

		public void Add(T item)
		{
			throw new NotImplementedException();
		}

		public void Clear()
		{
			throw new NotImplementedException();
		}

		public bool Contains(T item)
		{
			throw new NotImplementedException();
		}

		public void CopyTo(T[] array, int arrayIndex)
		{
			throw new NotImplementedException();
		}

		public int Count
		{
			get { throw new NotImplementedException(); }
		}

		public bool IsReadOnly
		{
			get { throw new NotImplementedException(); }
		}

		public bool Remove(T item)
		{
			throw new NotImplementedException();
		}

		#endregion

		#region IEnumerable<T> Members

		public IEnumerator<T> GetEnumerator()
		{
			throw new NotImplementedException();
		}

		#endregion

		#region IEnumerable Members

		System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
		{
			throw new NotImplementedException();
		}

		#endregion
	}
}
